import primes
import time

start_t = time.time()
cython_list = primes.primes(1000)
end_t = time.time()

print(cython_list)
print("Cython time cost: {}".format(end_t - start_t))

def python_primes(nb_primes):
    
    if nb_primes > 1000:
        nb_primes = 1000
    
    len_p = 0
    n = 2
    p = []
    while len_p < nb_primes:
        print(len_p)
        for i in p:
            if n % i == 0:
                break
        else:
            p.append(n)
            len_p +=1
        n+=1
    result = [prime for prime in p]
    return result

start = time.time()
python_list = python_primes(1000)
end = time.time()
print(python_list)
print("Python time cost: {}".format(end-start))